package com.zy.voteya.controller;

import com.zy.voteya.entity.Result;
import com.zy.voteya.service.BizException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExHandler {

    @ExceptionHandler(BizException.class)
    Object handleBizException(BizException e){
        return Result.fail(e.getMessage(),e.getData());
    }
}
